home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Hacks / Hacks ’93 / Listen to your hack…beat / trap patches / utils.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-18  |  396 b   |  21 lines  |  [TEXT/KAHL]

  1. #include "const.h"
  2. #include "globals.h"
  3. #include "utils.h"
  4.  
  5. void PatchTrap(short trapWord,short trapType,ProcPtr newAddress,Ptr *linkAddress)
  6. {
  7.     newAddress = StripAddress((Ptr)newAddress);
  8.     *linkAddress = (Ptr)NGetTrapAddress(trapWord,trapType);
  9.     NSetTrapAddress((long)newAddress,trapWord,trapType);
  10. }
  11.  
  12.  
  13. void __GetA4(void)
  14. {
  15.     asm {
  16.         bsr.s    @1
  17.         dc.l    0            ;  store A4 here
  18. @1        move.l    (sp)+,a1
  19.     }
  20. }
  21.